/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufsc.aps.jogodavida.view;

/**
 *
 * @author gustavo
 */
public class DialogCartaCoringa extends javax.swing.JDialog {
    
    private char naipe;
    
    public char getNaipeEscolhido() {
        return naipe;
    }

    /**
     * Creates new form DialogCoringa
     */
    public DialogCartaCoringa(PanelTabuleiro parent, boolean modal) {
        super(parent.getParentFrame(), modal);
        initComponents();
        this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        this.setLocationRelativeTo(parent);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        bNaipeA = new javax.swing.JButton();
        bNaipeB = new javax.swing.JButton();
        bNaipeC = new javax.swing.JButton();
        bNaipeD = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jLabel1.setText("Escolha o naipe para a carta coringa:");

        bNaipeA.setText("A");
        bNaipeA.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bNaipeAActionPerformed(evt);
            }
        });

        bNaipeB.setText("B");
        bNaipeB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bNaipeBActionPerformed(evt);
            }
        });

        bNaipeC.setText("C");
        bNaipeC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bNaipeCActionPerformed(evt);
            }
        });

        bNaipeD.setText("D");
        bNaipeD.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bNaipeDActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(42, 42, 42))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(bNaipeA, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(bNaipeB, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(bNaipeC, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(bNaipeD, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(bNaipeA)
                .addGap(18, 18, 18)
                .addComponent(bNaipeB)
                .addGap(18, 18, 18)
                .addComponent(bNaipeC)
                .addGap(18, 18, 18)
                .addComponent(bNaipeD)
                .addContainerGap(30, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void bNaipeAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bNaipeAActionPerformed
        this.naipe = 'A';
        this.dispose();
    }//GEN-LAST:event_bNaipeAActionPerformed

    private void bNaipeBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bNaipeBActionPerformed
        this.naipe = 'B';
        this.dispose();
    }//GEN-LAST:event_bNaipeBActionPerformed

    private void bNaipeCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bNaipeCActionPerformed
        this.naipe = 'C';
        this.dispose();
    }//GEN-LAST:event_bNaipeCActionPerformed

    private void bNaipeDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bNaipeDActionPerformed
        this.naipe = 'D';
        this.dispose();
    }//GEN-LAST:event_bNaipeDActionPerformed

    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bNaipeA;
    private javax.swing.JButton bNaipeB;
    private javax.swing.JButton bNaipeC;
    private javax.swing.JButton bNaipeD;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
